package com.peanut.youfupay.service.other;


import com.peanut.youfupay.service.BaseService;
import com.peanut.youfupay.util.Base64Utils;
import com.peanut.youfupay.util.DESUtils;
import com.peanut.youfupay.util.HtmlUtil;
import com.peanut.youfupay.util.JsonUtils;

import java.util.HashMap;
import java.util.Map;
/**
 * 忽略不再使用
 * Created by wangxiaodong on 2019/8/22.
 */
@Deprecated
public class TestSignContractForm extends BaseService {

	/**
	 * 商户平台代付技术对接：ApiKey=interKey
	 */
	static String interKey = "AD21F7D934B267E41FC09EE4895AAF42";
	static String charset = "UTF-8";
	/**
	 * 商户私钥：商户使用私钥进行签名
	 */

	static String priKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJXprx3wqgbfJreBJDStzh+aUC5nLwA4b6hrbS6PxqTfB/QG6O5cVZUtpT7j5F69+SHRP3IxrX6ZStN1IisisTy6UGPwg/PUbHaNU89/eEWV6nsbWFb8v4z4zKXFti8mLFPLF3GUWFBVSsFRiU5MvTppleRej53Gn8v1j8Pk1kCzAgMBAAECgYBt6OuUBuuRqC/poEwcN0WFVAzvSIVkIvxyPXjKB217WW2qUxqaD6ZLfjDGAC1h7ORoD9L1dUifJeJ/UESh3YiVN5qsAH/NRflYdxZMUPGtpNbh4m5VeEmUUX6uNrBmG7+EWIMbdHOG+MYU+CGibFbghRSLfEWvd1MQruav7WECyQJBAPaWFy3Ye7yfLmXPr/oapHxD+nC0lULsfx8tSOcpNlml56XLJLy4VkD7K3seQPI15MhryMgLPiRXYu8UtzjGR+8CQQCbosuXDSblpalKTECvkWnN9wDTz/6pu+KbxrzKcJ+LldtazGCqFmXRg8i3w3ns9B1njbnI5u4ryEY7/fep8+99AkBlN2SaT/MykJCGAAM3ATqlO24QVz+xccwYawkywarqj3wPhNw2jt/w2miVp+x2v4KCdiO7YUoHtssIYhN3PYSHAkBshTISbDBAFqgZT1wXT3yICgAAsVov/fs/hW7kdW06Bk8CW9nXH3D1iz9sqxecGodaSl9N74AI9UfL0wVa8uV9AkEA2L4+utLbEgMxlbt01h40vRSTLvyJyI7AtDJj86oIXQL2HZm+ALGLYGdmJf6D1fDoNhatj16lw+8SNhV+0zx0YA==";
	/**
	 * 优付公钥：商户使用优付公钥验签
	 */
	static String pubKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXFtJNcCv9X+pfOz+jy4WO+7KC0tdtDGfW/XrJOFn6mTR/TpJrsLzwssTyj0hDfUla1xDCbAWlUEkzb64jsPKk9WACupLOOrnEy7NuG0O5jg36UXle+m5/uDm8B/KGV9BQmEt+EOIbl2IzNYS4GflkbCTtkbzMc+DXetl3IHM1+wIDAQAB";


	/**优付内网测试地址**/
	static String url = "http://192.168.40.51:8280/pctrans-business/clientBusiness/common.do";
	/** 商户测试地址**/
//	static String url = "http://223.223.194.233:7280/pctrans-business/clientBusiness/common.do";
	/**本地tomcat测试地址**/
//	static String url = "http://127.0.0.1:8080/pctrans-business/clientBusiness/common.do";
	/**生产地址**/
//	static String url = "http://api.youfupingtai.com/pctrans-business/clientBusiness/common.do";

	public static void main(String[] args) throws Exception {

		Map paramsMap = new HashMap(2);
		paramsMap.put("merId","89900000222116027420");
		paramsMap.put("sohoFlag", "1");
		String json = buildReqData();
		byte[] bs = DESUtils.encrypt(json.getBytes(charset), interKey);
		String reqDataEncrypt = Base64Utils.encodeToString(bs);
		paramsMap.put("reqData", reqDataEncrypt);
		String form = HtmlUtil.getFormHtml(paramsMap, url);
		System.out.println(form);

	}

	private static String buildReqData() {
		Map reqData = new HashMap(2);
		reqData.put("otherParam","other");
		String json = JsonUtils.toJson(reqData);
		return json;
	}

}
